package com.qiyu.tech.pay.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @Author linhao
 * @Date created in 11:00 上午 2021/4/4
 */
@RestController
@Slf4j
public class BussinessController {

    public static int[] add = new int[]{0,0,0,0,1};
    public static int temp = 0;

    @PostMapping(value = "/bus-notify")
    public ResponseEntity<String> doNotifyInBusiness(HttpServletRequest request){
        Map<String,String[]> paramMap = request.getParameterMap();
        temp++;
        if(temp<5){
            return ResponseEntity.ok("fail");
        }
        System.out.println(paramMap);
        log.info("bus notify success");
        temp=0;
        return ResponseEntity.ok("success");
    }
}
